unit RProfiler;

interface

type
  TRTimer=class
  private
    t1,t2:Int64;
  public
    function Start:Integer;
    function Stop:Integer;
    function Interval:double;
  end;

implementation
uses Windows;
{ TRTimer }

function TRTimer.Interval;
var
  perfFreq:Int64;
begin
  QueryPerformanceFrequency(perfFreq);
  Result:=(t2-t1) / perfFreq;
end;

function TRTimer.Start: Integer;
begin
  QueryPerformanceCounter(t1);
  Result:=t1
end;

function TRTimer.Stop: Integer;
begin
  QueryPerformanceCounter(t2);
  Result:=t2-t1;
end;

end.
